package com.ezerg.token;

import com.ezerg.boot.util.RedisUtil;
import com.ezerg.util.CodecUtil;

public class RedisTokenManager implements TokenManager {

	private RedisUtil redisUtil = new RedisUtil();
	
	public String createToken(String username) {
		String token = CodecUtil.createUUID();
		redisUtil.set(token, username);
		return token;
	}

	public boolean checkToken(String token) {
		return redisUtil.exists(token);
	}

	public void deleteToken(String token) {
		redisUtil.get(token);
	}

}
